import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';
import 'package:finance_app/src/entities/account_entity.dart';
import 'package:finance_app/src/entities/business_contact_entity.dart';
import 'package:finance_app/src/entities/cpf_contribution_entity.dart';
import 'package:finance_app/src/entities/payslips_item_entity.dart';
import 'package:finance_app/src/entities/setting_data_entity.dart';
import 'package:finance_app/src/page/dashboard/expense/new_expense_page.dart';

class PaymentDetailEntity with JsonConvert<PaymentDetailEntity> {
  @JSONField(name: "data_type")
  String dataType;
  int id;
  @JSONField(name: "flow_type")
  String flowType;
  String type;
  String name;
  String number;
  @JSONField(name: "contact_id")
  int contactId;
  @JSONField(name: "account_id")
  int accountId;
  @JSONField(name: "payment_type_id")
  int paymentTypeId;
  @JSONField(name: "tax_id")
  int taxId;
  @JSONField(name: "is_tax_inclusive")
  int isTaxInclusive;
  SettingDataTax tax;
  @JSONField(name: "issued_at")
  String issuedAt;
  List<String> numbers;
  @JSONField(name: "number_ids")
  List<int> numberIds;
  @JSONField(name: "currency_code")
  String currencyCode;
  num total;
  @JSONField(name: "cheque_number")
  dynamic chequeNumber;
  String notes;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;
  String status;
  List<ExpenseDetailEntity> expense;
  List<CpfContributionEntity> cpfcontributions;
  List<PayslipsItemEntity> payslips;
  List<OcrAttachmentEntity> attachments;
  PaymentDetailPivot pivot;

  AccountEntity account;

  BusinessContactEntity contact;
  @JSONField(name: "account_total")
  num accountTotal;
}

class PaymentDetailPivot with JsonConvert<PaymentDetailPivot> {
  @JSONField(name: "paymentable_id")
  int paymentabled;
  @JSONField(name: "payment_id")
  int paymentId;
  String amount;
}
